﻿@model List<NccImageSlider>

@{
    Layout = Constants.AdminLayoutName;
    Title = "Image Slider Manage";
    SubTitle = "Manage image slider contents and design";
    string mainController = "ImageSliderHome";
}
    
<div class="row">
    <div class="col-lg-12">
        <div class="panel panel-default">
            <div class="panel-heading">
                @SubTitle
                <div class="pull-right"><a asp-controller="@mainController" asp-action="CreateEdit" class="btn btn-outline btn-primary btn-xs">Add New</a></div>
            </div>
            <div class="panel-body">
                <table id="pageListDt" class="table table-striped table-bordered" cellspacing="0" width="100%">
                    <thead>
                        <tr>
                            <th>Name</th>
                            <th>Interval (sec)</th>
                            <th>Image Width</th>
                            <th>Image Height</th>
                            <th>Total Slide</th>
                            <th>CreateBy</th>
                            <th>Status</th>
                            <th>Shotcode</th>
                            <th>Action</th>
                        </tr>
                    </thead>
                    <tbody>
                        @foreach (var item in Model)
                        {
                            <tr>
                                <td>@item.Name</td>
                                <td>@item.Interval</td>
                                <td>@item.ImageWidth</td>
                                <td>@item.ImageHeight</td>
                                @if (item.ImageItems != null)
                                {
                                    <td>@item.ImageItems.Count()</td>
                                }
                                else
                                {
                                    <td>-</td>
                                }
                                <td>@item.CreateBy</td>
                                <td>@item.Status</td>
                                <td>[NccImageSlider Id="@item.Id" NccImageSlider]</td>
                                <td>
                                    <a asp-controller="@mainController" asp-action="CreateEdit" asp-route-id="@item.Id">Edit</a> |
                                    <a asp-controller="@mainController" asp-action="Delete" asp-route-id="@item.Id">Delete</a>
                                </td>
                            </tr>
                        }
                    </tbody>
                </table>
            </div>
            <!-- /.panel-body -->
        </div>
        <!-- /.panel -->
    </div>
</div>



@section Scripts{

}
